package com.jiyun.service.Impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.jiyun.mapper.ManagementMapper;
import com.jiyun.model.management.Management;
import com.jiyun.model.management.ManagementVO;
import com.jiyun.service.ManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Date;

@Service
public class ManagementServiceImpl  extends ServiceImpl<ManagementMapper,Management> implements ManagementService {
    @Autowired
    ManagementMapper managementMapper;


    @Override
    public IPage<ManagementVO> findAll(Integer current, Integer size, ManagementVO vo) {

        Page<ManagementVO> page = new Page<>(current, size);
        page=managementMapper.findAll(page,vo);
        return page;
    }

    @Override
    public Boolean add(Management management) {
        management.setSjoindate(new Date());
        management.setSstatus(1);
        managementMapper.insert(management);
        return true;
    }


}
